package expo43server;

/*
 * 
 * THINGS THIS SERVER DOES:
 * Break the intro loop
 * Start ITopia film
 * start the game
 * start the credits
 */


import java.net.*;
import java.io.*;
/**
 *
 * @author TommySprat
 */
public class Expo43Server {

    ServerSocket serverSocket;
    Socket clientSocket;
    PrintWriter out;
    String inputLine, outputLine;
    
    public Expo43Server() throws IOException {
        
        serverSocket = null;
        try {
            serverSocket = new ServerSocket(4444);
        } catch (IOException e) {
            System.err.println("Could not listen on port: 4444.");
            System.exit(1);
        }
        
        clientSocket = null;
        try {
            //Waits until a client connects on serverSocket
            clientSocket = serverSocket.accept();
            System.out.println("Client connected");
        } catch (IOException e) {
            System.err.println("Accept failed.");
            System.exit(1);
        }
        
        out = new PrintWriter(clientSocket.getOutputStream(), true);
        BufferedReader in = new BufferedReader(
				new InputStreamReader(
				clientSocket.getInputStream()));
               
        out.println("Welcome e43Client");
        
    }
    
    public void startGame(){
        out.println("startgame");
    }
    public void stopGame(){
        out.println("stopgame");
    }
    
    public void startPlaylist(){
        out.println("startplaylist");
    }
    public void stopPlaylist(){
        out.println("stopplaylist");
    }
    public void setScene(String scene){
        out.println(scene);
    }
}
